<template>
	<view class="content">{{msgContent}}</view>
</template>

<script>
	import {mapState} from 'vuex';
	import msgService from "@/services/msg";
	const service = new msgService();
	export default{
		data(){
			return{
				id:'',
			}
		},
		computed:{
			...mapState({
				msgContent: state => state.msgStore.msgContent,
			}),
		},
		onLoad({id,isRead}) {
			this.id = id;
			if(isRead=='0'){
				this.readWebsite();
			}
		},
		onUnload() {
			
		},
		methods:{
			readWebsite(){
				service.readWebsite({id:this.id}).then(response=>{
					if(response.success){
						uni.$emit('readed');
					}
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		background-color: #fff;
		padding: 20upx;
		margin-bottom: 90upx;
		font-size: 30upx;
		color: #333333;
		line-height: 50upx;
	}
</style>
